Skip to content

Fix all remaining ruff check error - #242

Merged
jtniehof merged 4 commits into
IMAP-Science-Operations-Center:mainfrom
jtniehof:ruff_further
Oct 26, 2026
Merged

jtniehof merged 4 commits into
IMAP-Science-Operations-Center:mainfrom
jtniehof:ruff_further

Conversation

@jtniehof

Copy link
Copy Markdown
Collaborator

Change Summary

Overview

Fix all errors reported so ruff check runs clean.

This is all hand-done so should actually be reviewed!

File changes

Only noting changes that seem to be a judgement call in some way, rather than "obvious'

  • Unused variables that seemed to be a "side effect" were changed to _ so they are obviously temps. Otherwise I usually removed them.
  • tests/test_data/lo/lo_txt_pipeline: for several files here, I left the unused variables (either side effects or seemed worthwhile documentation) and noqa'd them.
  • I decided to disable E741, "ambiguous variable name". We use l quite a bit in the code (and in code we've incorporated) so this feels okay to quiet. But I'm not tied to it.
  • imap_l3_processing/maps/mpfit.py is a weird case. It's brought in from external source, but since we did basically reformat it as part of this process, I figure we "own" it.
    • I fixed the things that were obvious (e.g. comparisons to None).
    • catch_msg is assigned to but never used. My understanding is that it's supposed to be diagnostic like errmsg, so I made it a class member rather than a local.
    • errmsg was treated as a local in one place, so I changed that to refer to the class member.
  • imap_l3_processing/predicted_emphemeris_tracker.py used type parameter syntax introduced in Python 3.12. We have 3.10 as the minimum. I wrote it back in the old format (as far as I could discern, not having used it much!) Worth a double-check

Testing

Relying on existing unit tests

@jtniehof jtniehof added this to IMAP Oct 26, 2026
@jtniehof

Copy link
Copy Markdown
Collaborator Author

Test failure was name resolution error with Space Weather Canada, and restarting the test fixed it.

@leowerneck leowerneck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jtniehof

Copy link
Copy Markdown
Collaborator Author

I will loop in with Menlo and the GLOWS and Lo teams regarding code that the instrument teams are contributing but not maintaining in our tree, so we're all on the same page.

@jtniehof
jtniehof merged commit 887bfc8 into IMAP-Science-Operations-Center:main Oct 26, 2026
32 of 33 checks passed
@github-project-automation github-project-automation Bot moved this to Done in IMAP Oct 26, 2026
@jtniehof
jtniehof deleted the ruff_further branch October 27, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants